package com.spring.aop.jdkproxy;

import static org.junit.Assert.*;

import org.junit.Test;

public class UserDaoImplTest {

	
	/*
	 * 传统的new实例调用
	 */
	
	
	@Test
	public void test() {
		UserDao userDao=new UserDaoImpl();
		userDao.save();
		userDao.find();
		userDao.update();
		userDao.deleta();
	}
	
	
	
	/*
	 * 使用jdk代理模式
	 */

	@Test
	public void JdkProxyTest() {
		
		UserDao userDao=new UserDaoImpl();
		//创建代理
		UserDao proxy=new JdkProxy(userDao).createProxy();
		
		proxy.save();
		proxy.update();
		proxy.find();
		proxy.deleta();
	}
}
